Integrand size = 25, antiderivative size = 123 \[ \int (a+a \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{8} a^2 (12 A+7 C) x+\frac {a^2 (12 A+7 C) \sin (c+d x)}{6 d}+\frac {a^2 (12 A+7 C) \cos (c+d x) \sin (c+d x)}{24 d}-\frac {C (a+a \cos (c+d x))^2 \sin (c+d x)}{12 d}+\frac {C (a+a \cos (c+d x))^3 \sin (c+d x)}{4 a d} \]
1/8*a^2*(12*A+7*C)*x+1/6*a^2*(12*A+7*C)*sin(d*x+c)/d+1/24*a^2*(12*A+7*C)*c os(d*x+c)*sin(d*x+c)/d-1/12*C*(a+a*cos(d*x+c))^2*sin(d*x+c)/d+1/4*C*(a+a*c os(d*x+c))^3*sin(d*x+c)/a/d
Time = 0.35 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.59 \[ \int (a+a \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {a^2 (144 A d x+84 C d x+48 (4 A+3 C) \sin (c+d x)+24 (A+2 C) \sin (2 (c+d x))+16 C \sin (3 (c+d x))+3 C \sin (4 (c+d x)))}{96 d} \]
(a^2*(144*A*d*x + 84*C*d*x + 48*(4*A + 3*C)*Sin[c + d*x] + 24*(A + 2*C)*Si n[2*(c + d*x)] + 16*C*Sin[3*(c + d*x)] + 3*C*Sin[4*(c + d*x)]))/(96*d)
Time = 0.44 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.99, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3042, 3503, 3042, 3230, 3042, 3123}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a \cos (c+d x)+a)^2 \left (A+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^2 \left (A+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3503 |
\(\displaystyle \frac {\int (\cos (c+d x) a+a)^2 (a (4 A+3 C)-a C \cos (c+d x))dx}{4 a}+\frac {C \sin (c+d x) (a \cos (c+d x)+a)^3}{4 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (a (4 A+3 C)-a C \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{4 a}+\frac {C \sin (c+d x) (a \cos (c+d x)+a)^3}{4 a d}\) |
\(\Big \downarrow \) 3230 |
\(\displaystyle \frac {\frac {1}{3} a (12 A+7 C) \int (\cos (c+d x) a+a)^2dx-\frac {a C \sin (c+d x) (a \cos (c+d x)+a)^2}{3 d}}{4 a}+\frac {C \sin (c+d x) (a \cos (c+d x)+a)^3}{4 a d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {1}{3} a (12 A+7 C) \int \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2dx-\frac {a C \sin (c+d x) (a \cos (c+d x)+a)^2}{3 d}}{4 a}+\frac {C \sin (c+d x) (a \cos (c+d x)+a)^3}{4 a d}\) |
\(\Big \downarrow \) 3123 |
\(\displaystyle \frac {\frac {1}{3} a (12 A+7 C) \left (\frac {2 a^2 \sin (c+d x)}{d}+\frac {a^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3 a^2 x}{2}\right )-\frac {a C \sin (c+d x) (a \cos (c+d x)+a)^2}{3 d}}{4 a}+\frac {C \sin (c+d x) (a \cos (c+d x)+a)^3}{4 a d}\) |
(C*(a + a*Cos[c + d*x])^3*Sin[c + d*x])/(4*a*d) + (-1/3*(a*C*(a + a*Cos[c + d*x])^2*Sin[c + d*x])/d + (a*(12*A + 7*C)*((3*a^2*x)/2 + (2*a^2*Sin[c + d*x])/d + (a^2*Cos[c + d*x]*Sin[c + d*x])/(2*d)))/3)/(4*a)
3.1.11.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(2*a^2 + b^ 2)*(x/2), x] + (-Simp[2*a*b*(Cos[c + d*x]/d), x] - Simp[b^2*Cos[c + d*x]*(S in[c + d*x]/(2*d)), x]) /; FreeQ[{a, b, c, d}, x]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(b*(m + 1)) Int[(a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^ (m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^ m*Simp[A*b*(m + 2) + b*C*(m + 1) - a*C*Sin[e + f*x], x], x], x] /; FreeQ[{a , b, e, f, A, C, m}, x] && !LtQ[m, -1]
Time = 5.12 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.58
method | result | size |
parallelrisch | \(\frac {3 \left (\left (\frac {A}{6}+\frac {C}{3}\right ) \sin \left (2 d x +2 c \right )+\frac {\sin \left (3 d x +3 c \right ) C}{9}+\frac {\sin \left (4 d x +4 c \right ) C}{48}+\left (\frac {4 A}{3}+C \right ) \sin \left (d x +c \right )+d x \left (A +\frac {7 C}{12}\right )\right ) a^{2}}{2 d}\) | \(71\) |
risch | \(\frac {3 a^{2} x A}{2}+\frac {7 a^{2} C x}{8}+\frac {2 \sin \left (d x +c \right ) A \,a^{2}}{d}+\frac {3 \sin \left (d x +c \right ) a^{2} C}{2 d}+\frac {\sin \left (4 d x +4 c \right ) a^{2} C}{32 d}+\frac {\sin \left (3 d x +3 c \right ) a^{2} C}{6 d}+\frac {\sin \left (2 d x +2 c \right ) A \,a^{2}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) a^{2} C}{2 d}\) | \(118\) |
parts | \(a^{2} x A +\frac {\left (A \,a^{2}+a^{2} C \right ) \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a^{2} C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {2 \sin \left (d x +c \right ) A \,a^{2}}{d}+\frac {2 a^{2} C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}\) | \(126\) |
derivativedivides | \(\frac {A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 A \,a^{2} \sin \left (d x +c \right )+\frac {2 a^{2} C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+A \,a^{2} \left (d x +c \right )+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(142\) |
default | \(\frac {A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 A \,a^{2} \sin \left (d x +c \right )+\frac {2 a^{2} C \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+A \,a^{2} \left (d x +c \right )+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(142\) |
norman | \(\frac {\frac {a^{2} \left (12 A +7 C \right ) x}{8}+\frac {5 a^{2} \left (4 A +5 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {11 a^{2} \left (12 A +7 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {a^{2} \left (12 A +7 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {a^{2} \left (12 A +7 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {3 a^{2} \left (12 A +7 C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {a^{2} \left (12 A +7 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {a^{2} \left (12 A +7 C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {a^{2} \left (156 A +83 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(229\) |
3/2*((1/6*A+1/3*C)*sin(2*d*x+2*c)+1/9*sin(3*d*x+3*c)*C+1/48*sin(4*d*x+4*c) *C+(4/3*A+C)*sin(d*x+c)+d*x*(A+7/12*C))*a^2/d
Time = 0.27 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.70 \[ \int (a+a \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (12 \, A + 7 \, C\right )} a^{2} d x + {\left (6 \, C a^{2} \cos \left (d x + c\right )^{3} + 16 \, C a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (4 \, A + 7 \, C\right )} a^{2} \cos \left (d x + c\right ) + 16 \, {\left (3 \, A + 2 \, C\right )} a^{2}\right )} \sin \left (d x + c\right )}{24 \, d} \]
1/24*(3*(12*A + 7*C)*a^2*d*x + (6*C*a^2*cos(d*x + c)^3 + 16*C*a^2*cos(d*x + c)^2 + 3*(4*A + 7*C)*a^2*cos(d*x + c) + 16*(3*A + 2*C)*a^2)*sin(d*x + c) )/d
Leaf count of result is larger than twice the leaf count of optimal. 309 vs. \(2 (109) = 218\).
Time = 0.18 (sec) , antiderivative size = 309, normalized size of antiderivative = 2.51 \[ \int (a+a \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} \frac {A a^{2} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {A a^{2} x \cos ^{2}{\left (c + d x \right )}}{2} + A a^{2} x + \frac {A a^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 A a^{2} \sin {\left (c + d x \right )}}{d} + \frac {3 C a^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 C a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {C a^{2} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 C a^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {C a^{2} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 C a^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {4 C a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {5 C a^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {2 C a^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {C a^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (A + C \cos ^{2}{\left (c \right )}\right ) \left (a \cos {\left (c \right )} + a\right )^{2} & \text {otherwise} \end {cases} \]
Piecewise((A*a**2*x*sin(c + d*x)**2/2 + A*a**2*x*cos(c + d*x)**2/2 + A*a** 2*x + A*a**2*sin(c + d*x)*cos(c + d*x)/(2*d) + 2*A*a**2*sin(c + d*x)/d + 3 *C*a**2*x*sin(c + d*x)**4/8 + 3*C*a**2*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + C*a**2*x*sin(c + d*x)**2/2 + 3*C*a**2*x*cos(c + d*x)**4/8 + C*a**2*x*co s(c + d*x)**2/2 + 3*C*a**2*sin(c + d*x)**3*cos(c + d*x)/(8*d) + 4*C*a**2*s in(c + d*x)**3/(3*d) + 5*C*a**2*sin(c + d*x)*cos(c + d*x)**3/(8*d) + 2*C*a **2*sin(c + d*x)*cos(c + d*x)**2/d + C*a**2*sin(c + d*x)*cos(c + d*x)/(2*d ), Ne(d, 0)), (x*(A + C*cos(c)**2)*(a*cos(c) + a)**2, True))
Time = 0.20 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.07 \[ \int (a+a \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 96 \, {\left (d x + c\right )} A a^{2} - 64 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a^{2} + 3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} + 192 \, A a^{2} \sin \left (d x + c\right )}{96 \, d} \]
1/96*(24*(2*d*x + 2*c + sin(2*d*x + 2*c))*A*a^2 + 96*(d*x + c)*A*a^2 - 64* (sin(d*x + c)^3 - 3*sin(d*x + c))*C*a^2 + 3*(12*d*x + 12*c + sin(4*d*x + 4 *c) + 8*sin(2*d*x + 2*c))*C*a^2 + 24*(2*d*x + 2*c + sin(2*d*x + 2*c))*C*a^ 2 + 192*A*a^2*sin(d*x + c))/d
Time = 0.29 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.84 \[ \int (a+a \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {C a^{2} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {C a^{2} \sin \left (3 \, d x + 3 \, c\right )}{6 \, d} + \frac {1}{8} \, {\left (12 \, A a^{2} + 7 \, C a^{2}\right )} x + \frac {{\left (A a^{2} + 2 \, C a^{2}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (4 \, A a^{2} + 3 \, C a^{2}\right )} \sin \left (d x + c\right )}{2 \, d} \]
1/32*C*a^2*sin(4*d*x + 4*c)/d + 1/6*C*a^2*sin(3*d*x + 3*c)/d + 1/8*(12*A*a ^2 + 7*C*a^2)*x + 1/4*(A*a^2 + 2*C*a^2)*sin(2*d*x + 2*c)/d + 1/2*(4*A*a^2 + 3*C*a^2)*sin(d*x + c)/d
Time = 1.09 (sec) , antiderivative size = 117, normalized size of antiderivative = 0.95 \[ \int (a+a \cos (c+d x))^2 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {3\,A\,a^2\,x}{2}+\frac {7\,C\,a^2\,x}{8}+\frac {2\,A\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {3\,C\,a^2\,\sin \left (c+d\,x\right )}{2\,d}+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d}+\frac {C\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{6\,d}+\frac {C\,a^2\,\sin \left (4\,c+4\,d\,x\right )}{32\,d} \]